<!DOCTYPE html>
<html class="x-admin-sm">
  
  <head>
    <meta charset="UTF-8">
    <title>图片信息展示</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="./js/cookie.js"></script>
  </head>
  
  <body>
    <div class="x-body">
          <div class="layui-form-item" style="float:left;" id="img">
              
          </div>
    </div>
    <script>
       $(function(){
    	   var url = window.location.href;
    	   var tupian = getUrlParam(url,"tupian");
    	   var img =  tupian.split(',');
    	   $.each(img,function(i,item){
    		   var imgtest;
    		   if(item!=null && item!=""){
    			   var test = "http://localhost:8080" + item;
    			  // alert(test);
    			   imgtest = $('<img alt="" src="'+test+'" style="width: 300px">');
    		   }
    		   $("#img").append(imgtest);
    	   });
       });
      //获取url地址上参数
      function getUrlParam(url,name){
             var pattern = new RegExp("[?&]" + name +"\=([^&]+)","g");
             var matcher = pattern.exec(url);
             var items = null;
             if(matcher != null){
                  try{
                      items = decodeURIComponent(decodeURIComponent(matcher[1]));   
                  }catch(e){
                      try{
                          items = decodeURIComponent(matcher[1]);
                  }catch(e){
                          items = matcher[1];
                       }
                  }
              }
              return items;
        }
    </script>
  </body>
</html>